package com.gsoe.problem.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gsoe.problem.po.Problem;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 题目表 Mapper 接口
 * </p>
 *
 * @author xiaoma
 * @since 2024-10-27
 */
public interface ProblemMapper extends BaseMapper<Problem> {
    @Select("select p.* from problem as p where type=#{type} and deleted=false order by rand() limit #{num}")
    List<Problem> getRandIdListByType(@Param("type") int type,@Param("num") Integer num);

    /*下标顺序*/


    @Select("select * \n" +
            "from problem  ")
    List<Problem> getProblemDifficulty();
}
